#include <timer/timer.h>
#include <asm/asm.h>

//初始化时钟
void init_timer(u32_t freq)
{
    
    io_out8(TIMER_CMD_PORT, CMD_CHANNEL_0|CMD_RDWR_ALL|CMD_MODE_2|CMD_FORMAT_BINARY);
    io_out8(TIMER0_DATA_PORT, freq&0xff);
    io_out8(TIMER0_DATA_PORT, freq>>8);
}